package com.xinyi.shicihui.controller;

import com.xinyi.shicihui.dao.DynastyDao;
import com.xinyi.shicihui.pojo.entity.Dynasty;
import com.xinyi.shicihui.pojo.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author xinyi
 * @desc 朝代信息管理接口
 * @date 2022/1/21
 */
@RestController
@RequestMapping("/api/v1/dynasty")
public class DynastyController {

    @Autowired
    private DynastyDao dynastyDao;

    @GetMapping("/all")
    public Result<List<Dynasty>> all() {
        return Result.success(dynastyDao.findAll());
    }
}
